﻿using System;

/// <summary>
/// 观察者模式实现
/// </summary>
namespace ObserverPattern
{
    internal class BinaryObserver : ObServer
    {
        public BinaryObserver(Subject subject)
        {
            this.subject = subject;
            subject.Attach(this);
        }
        public override void Update()
        {
            Console.WriteLine("Binary:"+Convert.ToString(subject.GetState(),2));
        }
    }
}
